import { createRouter, createWebHistory } from 'vue-router';
// 引入组件
import ApiListComponent from "@/view/page/ApiListComponent"
import ApiContentComponent from '@/view/page/ApiContentComponent.vue';
import ApiContentAddComponent from '@/view/page/ApiContentAddComponent.vue';
import ApiContentModifyComponent from '@/view/page/ApiContentModifyComponent.vue';
 
// 定义路由
const routes = [
  {
    path: '/',
    redirect: '/api-list'
  },
  { 
    path: '/api-list', 
    component: ApiListComponent 
  },
  { path: '/api-content', 
    component: ApiContentComponent 
  },
  { path: '/api-add', 
    component: ApiContentAddComponent 
  },
  { path: '/api-modify/:id', 
    component: ApiContentModifyComponent 
  },
];
 
// 创建router实例
const router = createRouter({
  history: createWebHistory(),
  routes,
});
 
export default router;